﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Watson.TemporaryFilesDeleter
{
    /// <summary>
    /// Represents a single item in the log.
    /// </summary>
    public class LogItem
    {
        #region Public Properties

        /// <summary>
        /// Gets or sets the date and time the item was added to the log.
        /// </summary>
        public DateTime EnteredDateTime { get; set; }

        /// <summary>
        /// Gets or sets the log level of the log item.
        /// </summary>
        public LogLevel LogLevel { get; set; }

        /// <summary>
        /// Gets or sets the text of the log item.
        /// </summary>
        public string Text { get; set; }

        #endregion

        #region Public Constructors

        /// <summary>
        /// Initialises a new instance of the LogItem class.
        /// </summary>
        public LogItem()
        { }

        /// <summary>
        /// Initialises a new instance of the LogItem class specifying values
        /// for the entered date and time, log level and text.
        /// </summary>
        /// <param name="enteredDateTime">
        /// The date and time the item was added to the log.
        /// </param>
        /// <param name="logLevel">
        /// The log level of the log item.
        /// </param>
        /// <param name="text">
        /// The text of the log item.
        /// </param>
        public LogItem(DateTime enteredDateTime, LogLevel logLevel, 
            string text)
        {
            this.EnteredDateTime = enteredDateTime;
            this.LogLevel        = logLevel;
            this.Text            = text;
        }

        /// <summary>
        /// Initialises a new instance of the LogItem class specifying values
        /// for the log level and text. The entered date and time to the 
        /// current time.
        /// </summary>
        /// <param name="logLevel">
        /// The log level of the log item.
        /// </param>
        /// <param name="text">
        /// The text of the log item.
        /// </param>
        public LogItem(LogLevel logLevel, string text)
        {
            this.EnteredDateTime = DateTime.Now;
            this.LogLevel        = logLevel;
            this.Text            = text;
        }

        #endregion
    }
}
